/**
 * vue3 拖拽控件数组
 */
import i18LangUtil from "@/locales/lang/i18LangUtil.js";

/**
 * 国际化
 */
function i18n(name, text, key) {
    let lang=localStorage.getItem("language") || "zh-CN";
    let langObj=i18LangUtil.langeFilesHandler(lang);
    return langObj["apiFormBo"][name] || text || "";
}

const dragControls=[
    {label:i18n('standard','标准字段'),value:'rx-commonfield',dataType:['default','varchar','int','number','date'],length:100,isSingle:1},
    {label:i18n('reference','引用字段'),value:'rx-ref',dataType:['varchar'],length:100,isSingle:1},
    {label:i18n('textControl','文本控件'),value:'input',dataType:['varchar','number'],isSingle:1,length:50},
    {label:i18n('autoComplete','自动完成'),value:'autoComplete',dataType:['varchar'],isSingle:1,length:200},
    {label:i18n('number','数字控件'),value:'number',dataType:['number'],isSingle:1,length:14,decimalLength:0},
    {label:i18n('multiline','多行文本框'),value:'textarea',dataType:['varchar','clob'],isSingle:1,length:200},
    {label:i18n('select','下拉框'),value:'select',dataType:['varchar'],isSingle:1,length:50},
    {label:i18n('checkBox','复选框'),value:'checkbox',dataType:['varchar'],isSingle:1,length:50},
    {label:i18n('radio','单选'),value:'radio',dataType:['varchar'],isSingle:1,length:50},
    {label:i18n('switch','开关'),value:'switch',dataType:['varchar'],isSingle:1,length:20},
    {label:i18n('dateControl','日期控件'),value:'date',dataType:['date'],isSingle:1},
    {label:i18n('dateRange','日期范围控件'),value:'dateRange',dataType:['date'],isSingle:0},
    {label:i18n('time','时间控件'),value:'time',dataType:[['varchar']],isSingle:1,length:20},
    {label:i18n('richText','富文本框'),value:'editor',dataType:['clob'],isSingle:1,length:200},
    {label:i18n('score','评分控件'),value:'score',dataType:['number'],isSingle:1,length:5,decimalLength:1},
    {label:i18n('signature','签名控件'),value:'signature',dataType:['varchar'],isSingle:0,length:50},
    {label:i18n('address','地址控件'),value:'address',dataType:['varchar'],isSingle:0,length:200,extJson:{isCity:true,isCounty:true,isAddress:true}},
    {label:"Markdown",value:'markdown',dataType:['varchar'],isSingle:1,length:200},
    {label:i18n('hidden','隐藏域'),value:'hidden',dataType:['varchar'],isSingle:1,length:50},
    {label:i18n('slider','滑动条'),value:'slider',dataType:[['varchar']],isSingle:1,length:20},
    {label:i18n('map','地图选点'),value:'map',dataType:['varchar'],isSingle:1,length:200},
    {label:i18n('dropTree','下拉树'),value:'treeSelect',dataType:['varchar'],isSingle:1,length:200},
    {label:i18n('qRCode','二维码'),value:'QRCode',dataType:['varchar'],isSingle:1,length:200},
    {label:i18n('barCode','条形码'),value:'barCode',dataType:['varchar'],isSingle:1,length:200},
    {label:i18n('upload','上传附件'),value:'upload',dataType:['varchar'],isSingle:1,length:200},
    {label:i18n('imageUpload','上传图片'),value:'image',dataType:['varchar'],isSingle:1,length:200},
    {label:i18n('userControl','用户控件'),value:'user',dataType:['varchar'],isSingle:0,length:200},
    {label:i18n('department','部门控件'),value:'group',dataType:['varchar'],isSingle:0,length:50},
    {label:i18n('seal','印章'),value:'seal',dataType:['varchar'],isSingle:1,length:200},
    {label:i18n('area','地区控件'),value:'district',dataType:['varchar'],isSingle:1,length:200},
    {label:i18n('city','城市选择'),value:'city',dataType:['varchar'],isSingle:1,length:200},
    {label:i18n('editControl','编辑型控件'),value:'buttonEdit',dataType:['varchar'],isSingle:0,length:200},
    {label:i18n('rxButtonEditSingle','单值编辑'),value:'buttonEditSingle',dataType:['varchar'],isSingle:1,length:200},
    {label:i18n('rxButtonSelectSingle','单值选择'),value:'buttonSelectSingle',dataType:['varchar'],isSingle:1,length:200},
    {label:i18n('assoProcess','关联流程'),value:'relateProcess',dataType:['varchar'],isSingle:0,length:400},
    {label:i18n('generalField','通用字段'),value:'generalField',dataType:['default','varchar','int','number','date'],length:100,isSingle:1},
    {label:i18n('stage','阶段'),value:'stage',dataType:['varchar'],length:100,isSingle:1},
]

export { dragControls }